//配置结构
const { Schema, model } = require('mongoose');
//创建结构对象
const testsSchema = new Schema({
    AnswerTime: String,
    StayTime: String,
    Title: String,
    // KnowledgePointId: {
    //     type: Schema.Types.ObjectId,//指定类型
    //     ref: 'otherModel' //关联集合的模型名称，这个名称就是subjectsModel中const subjectsModel = model('subjectsModel', subjectsSchema, 'subjects') 的第一个参数
    // },
    TypeId: {
        type: Schema.Types.ObjectId,
        ref: 'examtypeModel'
    },
    KnowledgePointId: {
        type: Schema.Types.ObjectId,
        ref: 'otherModel'
    },
}, { versionKey: false });

//设置数据模型
const testsModel = model('testsModel', testsSchema, 'tests')

module.exports = {
    testsModel
}